//
//  ImagesCatonHomeViewController.m
//  AppCatonCollectDemo-iOS
//
//  Created by ciyouzen on 2017/2/25.
//  Copyright © 2017年 dvlproad. All rights reserved.
//

#import "ImagesCatonHomeViewController.h"

#import "CJImagesTableViewController1.h"
#import "CJImagesTableViewController2.h"
#import "CJImagesTableViewController3.h"

#import "ReuseStudyTableViewController.h"

@interface ImagesCatonHomeViewController ()

@end

@implementation ImagesCatonHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = NSLocalizedString(@"卡顿测试首页", nil); //知识点:使得tabBar中的title可以和显示在顶部的title保持各自
    self.view.backgroundColor = [UIColor whiteColor];
    
    NSMutableArray *sectionDataModels = [[NSMutableArray alloc] init];
    
    // Reuse Study
    {
        CQDMSectionDataModel *sectionDataModel = [[CQDMSectionDataModel alloc] init];
        sectionDataModel.theme = @"Reuse Study";
        {
            CQDMModuleModel *autoLayoutModule = [[CQDMModuleModel alloc] init];
            autoLayoutModule.title = @"Reuse Study";
            autoLayoutModule.classEntry = [ReuseStudyTableViewController class];
            
            [sectionDataModel.values addObject:autoLayoutModule];
        }
        [sectionDataModels addObject:sectionDataModel];
    }
    
    //ImagesTable
    {
        CQDMSectionDataModel *sectionDataModel = [[CQDMSectionDataModel alloc] init];
        sectionDataModel.theme = @"ImagesTable";
        {
            CQDMModuleModel *autoLayoutModule = [[CQDMModuleModel alloc] init];
            autoLayoutModule.title = @"ImagesTable1";
            autoLayoutModule.classEntry = [CJImagesTableViewController1 class];
            
            [sectionDataModel.values addObject:autoLayoutModule];
        }
        {
            CQDMModuleModel *autoLayoutModule = [[CQDMModuleModel alloc] init];
            autoLayoutModule.title = @"ImagesTable2";
            autoLayoutModule.classEntry = [CJImagesTableViewController2 class];
            
            [sectionDataModel.values addObject:autoLayoutModule];
        }
        {
            CQDMModuleModel *autoLayoutModule = [[CQDMModuleModel alloc] init];
            autoLayoutModule.title = @"ImagesTable3";
            autoLayoutModule.classEntry = [CJImagesTableViewController3 class];
            
            [sectionDataModel.values addObject:autoLayoutModule];
        }
        
        [sectionDataModels addObject:sectionDataModel];
    }
    
    self.sectionDataModels = sectionDataModels;
}


- (void)testPushNavigationController {
    UIViewController *viewController = [[UIViewController alloc] init];
    viewController.title = @"测试";
    viewController.view.backgroundColor = [UIColor yellowColor];
//    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
    if (self.navigationController) {
        //不能push navigationController
//        [self.navigationController pushViewController:navigationController animated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
